package com.cbwl.eoas.cms.model.eoas;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.hibernate.validator.constraints.Length;
import org.springframework.util.StringUtils;

import com.cbwl.eoas.common.base.CommonBean;
import com.cbwl.eoas.common.cache.redis.RedisCache;
import com.cbwl.eoas.common.cache.redis.RedisKeyPrefix;
import com.cbwl.eoas.common.util.SpringContextUtil;

/**
 * 
 * <p>[描述信息：意见反馈DTO]</p>
 *
 * @author 虞云波 - yuyunbo@3856.cc
 * @version 1.0 Created on 2017年11月27日 下午6:28:48
 */
public class AppOptionFeedbackDTO extends CommonBean {

	

	

	

	private static final long serialVersionUID = 2854379184101999236L;
	private java.lang.Long id;
	@Length(max=1024)
	private java.lang.String aofContext;
	@Length(max=5)
	private java.lang.String aofRestype;
	@Length(max=5)
	private java.lang.String aofStatus;
	@Length(max=1024)
	private java.lang.String aofBackContext;
	
	private java.lang.Long creater;
	
	private java.util.Date gmtCreate;
	
	private java.lang.Long modifier;
	
	private java.util.Date gmtModified;
	
	private String aofKey;
	
	//columns END

	private String aofRestypeName;
	
	private String aofStatusName;

	
	public void setId(java.lang.Long value) {
		this.id = value;
	}
	
	
	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	public java.lang.Long getId() {
		return this.id;
	}
	
	public void setAofContext(java.lang.String value) {
		this.aofContext = value;
	}
	
	public java.lang.String getAofContext() {
		return this.aofContext;
	}
	
	public void setAofRestype(java.lang.String value) {
		this.aofRestype = value;
		if (!StringUtils.isEmpty(value)) {
			RedisCache<String, String> redisCache = (RedisCache<String, String>) SpringContextUtil.getBean("redisCache");
			String redisValue =  redisCache.getStr(RedisKeyPrefix.DIC_PREFIX+value);
			if (!StringUtils.isEmpty(redisValue)) {
				this.aofRestypeName = redisValue;
			}
		}
	}
	
	public java.lang.String getAofRestype() {
		return this.aofRestype;
	}
	
	public void setAofStatus(java.lang.String value) {
		this.aofStatus = value;
		if (!StringUtils.isEmpty(value)) {
			RedisCache<String, String> redisCache = (RedisCache<String, String>) SpringContextUtil.getBean("redisCache");
			String redisValue =  redisCache.getStr(RedisKeyPrefix.DIC_PREFIX+value);
			if (!StringUtils.isEmpty(redisValue)) {
				this.aofStatusName = redisValue;
			}
		}
	}
	
	public java.lang.String getAofStatus() {
		return this.aofStatus;
	}
	
	public void setAofBackContext(java.lang.String value) {
		this.aofBackContext = value;
	}
	
	public java.lang.String getAofBackContext() {
		return this.aofBackContext;
	}
	
	public void setCreater(java.lang.Long value) {
		this.creater = value;
	}
	
	public java.lang.Long getCreater() {
		return this.creater;
	}
	
	public void setGmtCreate(java.util.Date value) {
		this.gmtCreate = value;
	}
	
	public java.util.Date getGmtCreate() {
		return this.gmtCreate;
	}
	
	public void setModifier(java.lang.Long value) {
		this.modifier = value;
	}
	
	public java.lang.Long getModifier() {
		return this.modifier;
	}
	
	public void setGmtModified(java.util.Date value) {
		this.gmtModified = value;
	}
	
	public java.util.Date getGmtModified() {
		return this.gmtModified;
	}
	public String getAofRestypeName() {
		return aofRestypeName;
	}
	public void setAofRestypeName(String aofRestypeName) {
		this.aofRestypeName = aofRestypeName;
	}
	public String getAofStatusName() {
		return aofStatusName;
	}
	public void setAofStatusName(String aofStatusName) {
		this.aofStatusName = aofStatusName;
	}

	
	public String getAofKey() {
		return aofKey;
	}


	
	public void setAofKey(String aofKey) {
		this.aofKey = aofKey;
	}


	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("AofContext",getAofContext())
			.append("AofRestype",getAofRestype())
			.append("AofStatus",getAofStatus())
			.append("AofBackContext",getAofBackContext())
			.append("AofKey",getAofKey())
			.append("Creater",getCreater())
			.append("GmtCreate",getGmtCreate())
			.append("Modifier",getModifier())
			.append("GmtModified",getGmtModified())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof AppOptionFeedbackDTO == false){return false;}
		if(this == obj){return true;}
		AppOptionFeedbackDTO other = (AppOptionFeedbackDTO)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.isEquals();
	}
}

